<?php
include_once("Application/ApplicationTemplate.php");
include_once("Security/SingleSignOn.php");

class PortalTemplate extends ApplicationTemplate {
	public function replaceTemplateVariables($fileContents) {
		$SSO = new SingleSignOn;
		$SessionInformation = $SSO->getSessionInformation();
		if(isset($SessionInformation['username']) && trim($SessionInformation['username']) != "") {		
			$fileContents = str_replace("{USER_FULLNAME}",$SessionInformation['fullname'],$fileContents);
			$fileContents = str_replace("{USER_USERNAME}","(".$SessionInformation['username'].")",$fileContents);
		}
		else {
			$fileContents = str_replace("{USER_FULLNAME}","",$fileContents);
			$fileContents = str_replace("{USER_USERNAME}","",$fileContents);
		}
		 
		return $fileContents;
	}
}
?>